home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
bench
/
x.txt
/
000289_shifeux@hotmail.com_Wed Jan 9 12:53:37 EST 2002.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
4KB
|
123 lines
Article: 13122 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!panix!bloom-beacon.mit.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: shifeux@hotmail.com (Shifeux)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Kermit 8 FTP scripting
Date: 9 Jan 2002 08:20:29 -0800
Organization: http://groups.google.com/
Lines: 104
Message-ID: <336f652d.0201090820.6b98e5cc@posting.google.com>
References: <336f652d.0201081116.4cd7a675@posting.google.com> <a1fhgv$sgj$1@watsol.cc.columbia.edu>
NNTP-Posting-Host: 208.178.159.150
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1010593230 18705 127.0.0.1 (9 Jan 2002 16:20:30 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 9 Jan 2002 16:20:30 GMT
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13122
I love you.
> First of all, I assume these IF FAIL commands don't have line breaks in your
> actual script. If they do, of course, the script has illegal syntax. So
> what you meant to write was:
>
> ftp cd \tmp\hello\
> if success write TRANSACTION-LOG FTP Server Message: \v(ftp_message)\13\10
> if fail write TRANSACTION-LOG FTP Server Message: \v(ftp_message)\13\10
Yep, I use google to post to the newsgroup and the lines wrap when I
paste into them.
> Second: You can eliminate the ugly \13\10 notation as follows:
>
> ftp cd \tmp\hello\
> if success writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
> if fail writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
All my code is ugly, but this is much better!
> Third: You shouldn't put an IF FAIL command after an IF SUCCESS command
> unless you really mean to; I don't think that's what you want in this. So:
>
> ftp cd \tmp\hello\
> if success {
> writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
> } else {
> writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
> }
this is exactly what I intended to do, I tried the if,then,else
originally but gave up after no success. I'll do it this way.
> Fourth: Since the IF and ELSE commands are identical, you don't need
> the IF statement at all:
>
> ftp cd \tmp\hello\
> writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
I was using the if,then to get both success or failure messages into
the logfile, not just the server ftp message
> Fifth: Backslash is a special character in Kermit commands. You might need
> to double them in your FTP CD command:
>
> ftp cd \\tmp\\hello\\
>
> Or try:
>
> ftp cd /tmp/hello/
i didn't have any backslash problems at all
> which might be accepted by the server.
>
> : I can't seem to add in an exit command to the if fail line. If i have:
> :
> : if fail exit 1 write TRANSACTION-LOG FTP Server message:
> : \v(ftp_message)
> :
> : the transaction log is never written.
> :
> Did you give a LOG TRANSACTIONS command to open it?
yes i just didn;t paste that into my post
> The optional EXIT command arguments are (1) a number (exit status code) and
> (2) a message to print (not a command to execute).
>
> : How and i string along more than
> : 1 command in this statement? A (,) does not do the trick.
> :
> The way to group commands in an IF statement is:
>
> if <condition> {
> command
> command
> ...
> }
>
> Of course you can also have an ELSE part with one or more commands:
>
> if <condition> {
> command
> command
> ...
> } else {
> command
> command
> ...
> }
>
> In your case:
>
> if fail {
> writeln TRANSACTION-LOG FTP Server message: \v(ftp_message)
> exit 1
> }
>
> - Frank
Thank you very much for the help, you are my hero.